@extends('admin.inc.base')
@section('content')

        <div class="panel panel-default">
            <div class="panel-heading">
                编辑菜单
            </div>
            <div class="panel-body">
                <form action="/admin/menu" method="post">
                    <div class="form-group">
                        <label for="">名称</label>
                        <input type="text" class="form-control" name="title"  placeholder="名称">
                    </div>

                    <div class="form-group">
                        <label for="">英文名称</label>
                        <input type="text" class="form-control" name="entitle"  placeholder="英文名称名称">
                        <div class="help-block">根据模板需要填写</div>
                    </div>


                    <div class="form-group">
                        <label for="">链接地址</label>
                        <input type="text" class="form-control" name="url"  placeholder="链接地址">
                    </div>

                    <div class="form-group">
                        <label for="">打开方式</label>
                        <select name="target" class="form-control">
                            <option value="_self">当前窗口</option>
                            <option value="_blank">新窗口</option>
                        </select>
                    </div>


                    <div class="form-group">
                        <label for="">父菜单</label>
                        <select name="pid" class="form-control">
                            <option value="0">顶级菜单</option>
                            @foreach( $menus as $key => $val )
                                @if($val['pid'] == 0)
                                <option value="{{ $val['id'] }}">{{ $val['title'] }}</option>
                                    @if(!empty($val['sub']))
                                        @foreach($val['sub'] as $sk => $sv)
                                            <option value="{{ $sv['id'] }}">----{{ $sv['title'] }}</option>
                                        @endforeach
                                    @endif
                                @endif
                            @endforeach
                        </select>

                        <p class="help-block"></p>
                    </div>

                    <div class="form-group">
                        <label for="">菜单类型</label>
                        <select name="position" class="form-control">
                            <option value="1">顶部菜单</option>
                            <option value="2">底部菜单</option>
                        </select>
                    </div>

                    <button type="submit" class="btn btn-default">提交</button>
                </form>
            </div>
        </div>

@endsection